package com.lanou.controller;

import com.lanou.bean.Student;
import com.lanou.service.StudentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo
 */
@Controller
public class MainController {
    @Resource
    private StudentService studentService;
    @RequestMapping(value = "/home")
    public String page(){
        return "home";
    }
    @ResponseBody
    @RequestMapping(value ="/getall")
    public List<Student> getAll(){
        return studentService.selectAll();
    }
}
